{% extends "base.html" %}
{% block title %}{% if user %}{{ user.nickname }} HomePage{% else %}{{ applicationName }} HomePage{% endif %}{% endblock %}
{% block header %}
	    {% if user %}
	    <form action='/' method='post' id='search_form'>
		<div id='topmenu'>
		    <div class='firsttopmenu'>
			<a href='/'>{{baseURL}}</a>
		    </div>
		    <div class='middletopmenu'>
			<input type='text' name='search' id='search_field' class='searchForm'/>
			<input type='button' id='searchbtn' value='Search' class='searchForm'/>
		    </div>
		    <div class='secondtopmenu'>
			<span class='menulink'>
			    <a class='menulink' id='addset' href='{{baseURL}}/ajax/addsetform.html'>New Set</a>
			    <a class='menulink' id='usageHistoryLink' href='{{baseURL}}/ajax/usageHistory.html'>Usage History</a>
			    <span class='current_user'>{{ user.getName }}</span>
			    <a class='menulink' href='{{ logout_url|escape }}'>Logout</a>
			</span>
		    </div>
		</div>
	    </form>
	    <div class='clear'/>
	    <div class='setlist'></div>
	    <div class='hideMe' id='hidden_setKey'></div>
	    <div class='hideMe' id='mesgArea'></div>
	    {% endif %}
{% endblock %}
{% block content %}
    {% if user %}
    {% else %}
        <div>
        {{ applicationName }} is an online electronic flash-card service designed to help me learn new materials, and remember old ones.  You may find this service useful if you are:
	<ol>
	 <li>students</li>
	 <li>working adults who have to learn new material, switch to another subject because of work requirement changes, and switch back later.</li>
	</ol>
	<p>To use {{applicationName}}, you must sign in through Gmail, or your favorite social / friend networking sites (facebook, myspace, etc).  Using our service implies that you have read and agree to our <a href='/ajax/tos.html'>terms of service</a>.  More information is available on our <a href='/ajax/faq.html'>frequently asked questions</a> page.  To sign in through Gmail, click <a href='{{ login_url }}'>here</a>.</p>
	</div>
    {% endif %}
{% endblock %}
{% block footer %}
    {% if user %}
    <p>
    <a href='/ajax/tos.html' class='footer'>Terms of Service</a>
    <a href='/ajax/faq.html' class='footer'>FAQ</a>
    <a href='/ajax/ourFeedback.html' class='footer'>Feedback</a>
    <a href='/ajax/contact.html' class='footer'>Contact us</a>
    </p>
    <p/>
    <script type='text/javascript'> $(document).ready(function(){ study.ready(); }); </script>
    {% else %}
    <script type='text/javascript'>
	$('#content').find('[href="/ajax/faq.html"]').click(study.displayPage);
	$('#content').find('[href="/ajax/tos.html"]').click(study.displayPage);
	$('#content').find('[href="/ajax/contact.html"]').click(study.displayPage);
    </script>
    {% endif %}
{% endblock %}
